package com.dirven.game.sprite;

import com.dirven.game.DirVenGame;
import com.dirven.game.NPC;

public class LightCycle extends NPC {
	
	long lastTimeMoved = 0;
	private int dx,
				dy;
	
	public static final int DIRECTION_NORTH = 0,
					  		DIRECTION_SOUTH = 1,
					  		DIRECTION_EAST = 2,
					  		DIRECTION_WEST = 3;
	
	private int direction = DIRECTION_EAST;
	
	public LightCycle(float x, float y) {
		super(x, y, "cycle", "blue.png");
	}
	
	public void setDirection(int newDir) {
		direction = newDir;
	}
	
	public boolean canMove() {
		long currTime = System.currentTimeMillis();
		long tDiff = currTime - lastTimeMoved;
		if(tDiff > 100) {
			lastTimeMoved = currTime;
			return true;
		}
		return false;
	}

	@Override
	public void move() {
		
		/*boolean canMove = canMove();
		if (canMove == false) {
			return;
		}
		
		switch(direction) {
			case DIRECTION_NORTH: dx = 0; dy = 16; break;
			case DIRECTION_SOUTH: dx = 0; dy = -16; break;
			case DIRECTION_EAST: dx = 16; dy = 0; break;
			case DIRECTION_WEST: dx = -16; dy = 0; break;
		}
		
		super.shiftPosition(dx, dy);
		
		float newX = super.getX();
		float newY = super.getY();
		
		if(newX > DirVenGame.screenWidth) {
			super.setX( -super.getWidth() );
		}
		
		if(newY > DirVenGame.screenHeight) {
			super.setY( 0 );
		}*/
	}
	
}
